package eighth.protected访问权限;
class SubHelloDemo extends HelloDemo{
    public void print(){
        System.out.println("访问受保护属性："+super.name);
    }
}
public class HelloDemo子类  {
    public static void main(String[] args) {
        SubHelloDemo subHelloDemo = new SubHelloDemo();
        subHelloDemo.print();
    }
}
/*
D:\WorkSpaces\Java\jdk-21\bin\java.exe "-javaagent:D:\Software\IntelliJ IDEA\IntelliJ IDEA 2023.3.2\lib\idea_rt.jar=51873:D:\Software\IntelliJ IDEA\IntelliJ IDEA 2023.3.2\bin" -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath D:\WorkSpaces\JavaDevelopBase_start_329\out\production\JavaDevelopBase_start_329 eighth.protected访问权限.HelloDemo子类
访问受保护属性：LXH

Process finished with exit code 0
 */
/**
 * 上面的程序在不同包的子类里访问了protected属性
 */